﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Comsenz.Services.Blocks.Models
{
    /// <summary>
    /// 数据项
    /// </summary>
    /// <author>Chiron</author>
    public class DataItem
    {
        #region Props
        /// <summary>
        /// 标志该数据的 id
        /// </summary>
        public object Id { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 资源地址
        /// </summary>
        public string Url { get; set; }
        /// <summary>
        /// 图片地址
        /// </summary>
        public string Pic { get; set; }
        /// <summary>
        /// 如果有图片，则该值标志图片的类型，0 为 url、1 为本地、2 为 ftp 远程；如果图片是 Discuz! X 系统中的图片可以情况设置为 1 或 2，其它情况为 0
        /// </summary>
        public int PicFlag { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Summary { get; set; }

        /// <summary>
        /// 其它字段值
        /// </summary>
        public Dictionary<object, object> Fields { get; set; }
        #endregion Props

        #region Methods
        /// <summary>
        /// 取得配置值
        /// </summary>
        /// <returns></returns>
        public Dictionary<object, object> GetConfigValue()
        {
            return new Dictionary<object, object>
            {
                {"id",Id},
                {"title",Title},
                {"url",Url},
                {"pic",Pic},
                {"picflag",PicFlag},
                {"summary",Summary},
                {"fields",Fields}
            };
        }
        #endregion Methods

    }
}
